<?php
 /**************************************************
* PluginLotto.com                                 *
* Copyrights (c) 2005-2010. iZAP                  *
* All rights reserved                             *
***************************************************
* @author iZAP Team "<support@izap.in>"
* @link http://www.izap.in/
* @version {version} $Revision: {revision}
* Under this agreement, No one has rights to sell this script further.
* For more information. Contact "Tarun Jangra<tarun@izap.in>"
* For discussion about corresponding plugins, visit http://www.pluginlotto.com/pg/forums/
* Follow us on http://facebook.com/PluginLotto and http://twitter.com/PluginLotto
 */

// getting all polls entity
// setting randome single entity to view on Main Page widget
$poll = get_random_poll_entities();

$url = func_set_href_byizap(array(
    'plugin' => GLOBAL_IZAP_POLL_PLUGIN,
    'page' => 'index',
));

// setting widget
if($poll) {
?>
<div class="index_box">
<?php 
   echo "<div>".elgg_view_title($poll->title);
?>
    <div  class="contentWrapper" >
    <?php
        echo func_izap_bridge_view('view/poll',array( 'plugin' => GLOBAL_IZAP_POLL_PLUGIN,  'entity' => $poll));
        ?>
        <div class="mainPage_all_polls"><?php echo '<a href="'.$url.'">'.elgg_echo('izap_poll:all_polls').'</a>' ?></div>
    </div>
        <?php
   echo "</div>";
?>
</div>
<?php
}